import React, { Component } from 'react';
export class ErrorBoundary extends Component {
    constructor (props: any) {
      super(props);
      this.state = { hasError: false };
    }
    static getDerivedStateFromError (error: any) {
      // Update state so the next render will show the fallback UI.
      console.log('fasdfasjkdhfajksdhfakjsd');
      return { hasError: true };
    }
    componentDidCatch (error: any) {
      console.error(error);
    }
    render () {
      // @ts-ignore
      if (this.state.hasError) {
        // You can render any custom fallback UI
        return <h1>Something went wrong.</h1>;
      }
  
      return this.props.children;
    }
  }